package goko.simple.api;

import com.lsl.rdf.result.BaseResult;
import com.lsl.rdf.result.page.PageResult;
import com.lsl.rdf.tuple.Tuple;
import goko.simple.contract.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by lsl on 2021/7/9.
 */
@RestController
@RequestMapping("goko")
public interface GoodsServiceRest {

    @PostMapping("/v1/demo/goods/_create")
    BaseResult<GoodsCreateResult> goodsCreateRest(@RequestBody @Validated GoodsCreateParam createParam);

    @PostMapping("/v1/demo/goods/_search")
    BaseResult<Tuple<List<GoodsSearchResult>>> goodsSearchRest(@RequestBody GoodsSearchParam searchParam);

    @PostMapping("/v1/demo/goods/_page")
    BaseResult<PageResult<GoodsPageSearchResult>> goodsPageRest(@RequestBody GoodsPageSearchParam pageParam);

    @PostMapping("/v1/demo/goods/_update")
    BaseResult<Boolean> goodsUpdateRest(@RequestBody @Validated GoodsUpdateParam updateParam);
}
